package de.velvettear.musiclister.gui;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import java.awt.GridBagLayout;

import javax.swing.JLabel;

import de.velvettear.musiclister.util.SettingsHelper;

import java.awt.GridBagConstraints;
import java.io.File;
import java.io.InputStream;
import java.awt.Insets;
import java.awt.Font;

public class Info extends JDialog {

	private final JPanel contentPanel = new JPanel();

	public static void main(String[] args) {
		try {
			Info dialog = new Info();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public Info() {
		setTitle("Info");
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		GridBagLayout gbl_contentPanel = new GridBagLayout();
		gbl_contentPanel.columnWidths = new int[]{0, 0};
		gbl_contentPanel.rowHeights = new int[]{0, 0, 0, 0};
		gbl_contentPanel.columnWeights = new double[]{1.0, Double.MIN_VALUE};
		gbl_contentPanel.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
		contentPanel.setLayout(gbl_contentPanel);
				
		JLabel lbl_icon = new JLabel("");
		GridBagConstraints gbc_lbl_icon = new GridBagConstraints();
		gbc_lbl_icon.insets = new Insets(10, 5, 5, 0);
		gbc_lbl_icon.gridx = 0;
		gbc_lbl_icon.gridy = 0;
		contentPanel.add(lbl_icon, gbc_lbl_icon);
		ImageIcon icon = getIcon();
		if (icon != null) {
			lbl_icon.setIcon(icon);
		}
		
		JLabel lbl_version = new JLabel("MusicLister 0.2");
		lbl_version.setFont(new Font("Tahoma", Font.BOLD, 14));
		GridBagConstraints gbc_lbl_version = new GridBagConstraints();
		gbc_lbl_version.anchor = GridBagConstraints.WEST;
		gbc_lbl_version.insets = new Insets(10, 5, 10, 0);
		gbc_lbl_version.gridx = 0;
		gbc_lbl_version.gridy = 1;
		contentPanel.add(lbl_version, gbc_lbl_version);
		
		JLabel lbl_copyright = new JLabel("Copyright \u00A9 2014. All Rights Reserved.");
		lbl_copyright.setFont(new Font("Tahoma", Font.PLAIN, 11));
		lbl_copyright.setToolTipText("");
		GridBagConstraints gbc_lbl_copyright = new GridBagConstraints();
		gbc_lbl_copyright.anchor = GridBagConstraints.SOUTH;
		gbc_lbl_copyright.insets = new Insets(0, 5, 10, 5);
		gbc_lbl_copyright.gridx = 0;
		gbc_lbl_copyright.gridy = 2;
		contentPanel.add(lbl_copyright, gbc_lbl_copyright);
		
		pack();
	}

	private ImageIcon getIcon() {				
		ImageIcon icon = new ImageIcon(this.getClass().getResource("/VelvetTear.png"));
				
		return icon;
	}
	
}
